package com.hyperboost.backend.service.impl;

import java.util.List;
import com.hyperboost.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hyperboost.backend.mapper.ShareTagRelationMapper;
import com.hyperboost.backend.domain.ShareTagRelation;
import com.hyperboost.backend.service.IShareTagRelationService;

/**
 * 分享与标签关联Service业务层处理
 * 
 * @author LXY
 * @date 2025-04-19
 */
@Service
public class ShareTagRelationServiceImpl implements IShareTagRelationService 
{
    @Autowired
    private ShareTagRelationMapper shareTagRelationMapper;

    /**
     * 查询分享与标签关联
     * 
     * @param id 分享与标签关联主键
     * @return 分享与标签关联
     */
    @Override
    public ShareTagRelation selectShareTagRelationById(Long id)
    {
        return shareTagRelationMapper.selectShareTagRelationById(id);
    }

    /**
     * 查询分享与标签关联列表
     * 
     * @param shareTagRelation 分享与标签关联
     * @return 分享与标签关联
     */
    @Override
    public List<ShareTagRelation> selectShareTagRelationList(ShareTagRelation shareTagRelation)
    {
        return shareTagRelationMapper.selectShareTagRelationList(shareTagRelation);
    }

    /**
     * 新增分享与标签关联
     * 
     * @param shareTagRelation 分享与标签关联
     * @return 结果
     */
    @Override
    public int insertShareTagRelation(ShareTagRelation shareTagRelation)
    {
        shareTagRelation.setCreateTime(DateUtils.getNowDate());
        return shareTagRelationMapper.insertShareTagRelation(shareTagRelation);
    }

    /**
     * 修改分享与标签关联
     * 
     * @param shareTagRelation 分享与标签关联
     * @return 结果
     */
    @Override
    public int updateShareTagRelation(ShareTagRelation shareTagRelation)
    {
        shareTagRelation.setUpdateTime(DateUtils.getNowDate());
        return shareTagRelationMapper.updateShareTagRelation(shareTagRelation);
    }

    /**
     * 批量删除分享与标签关联
     * 
     * @param ids 需要删除的分享与标签关联主键
     * @return 结果
     */
    @Override
    public int deleteShareTagRelationByIds(Long[] ids)
    {
        return shareTagRelationMapper.deleteShareTagRelationByIds(ids);
    }

    /**
     * 删除分享与标签关联信息
     * 
     * @param id 分享与标签关联主键
     * @return 结果
     */
    @Override
    public int deleteShareTagRelationById(Long id)
    {
        return shareTagRelationMapper.deleteShareTagRelationById(id);
    }
}
